<?php


namespace api\models;

use common\components\RedisCache;
use Yii;
use common\helpers\Helper;
use common\models\User;
use yii\db\ActiveRecord;
use yii\redis\Connection;

class UserModel extends User
{
	// use ModelTrait;  实现多继承

	public function attributes()
	{
		return parent::attributes();
	}

	/**
	 * 通过jwt token 获取用户信息
	 * @param mixed $token
	 * @param null $type
	 * @return array|ActiveRecord
	 */
	public static function findIdentityByAccessToken($token, $type = null)
	{
		return static::findOne(1);
			// ->where(['id' => (int)$token->claims()->get('id'), 'status' => self::STATUS_ACTIVE])->one();
	}

	public function fields()
	{
		$fields = parent::fields();
		return $fields;
	}


	public function extraFields()
	{
		$fields = parent::extraFields();
		return $fields;
	}
}
